/*
 * @Author: Superficial
 * @Date: 2021-01-03 00:48:01
 * @LastEditTime: 2022-05-29 13:25:15
 * @Description: 全局信息
 */

import request from "@/utils/request";

/**
 * @description: 获取博主信息
 */
export function getAdmin(params) {
  return request({
    url: "/auth",
    method: "get",
    params
  });
}

/**
 * @description: 获取选项信息
 */
export function getOptions(params) {
  return request({
    url: "/option",
    method: "get",
    params
  });
}

// 获取标签集合
export function getTags(params) {
  return request({
    url: "/tag",
    method: "get",
    params
  });
}

/**
 * @description: 获取所有友情连接
 * @param {Object} id 查询文章的id
 * @return {Object} Link 返回友情连接和总数
 */
export function getLinks(params) {
  return request({
    url: "/link",
    method: "get",
    params
  });
}

/**
 * @description: 点赞站点
 * @return {Boolean}  返回点赞状态
 */
export function likeSite() {
  return request({
    url: "/like/site",
    method: "patch"
  });
}

/**
 * @description: 公告信息
 * @return {Array}  返回公告列表
 */
export function getAnnouncements(params) {
  return request({
    url: "/announcement",
    method: "get",
    params
  });
}

/**
 * @description: 音乐列表接口
 * @return {Array}  返回音乐列表
 */
export function getMusicList(id) {
  return request({
    url: `/music/list/${id}`,
    method: "get"
  });
}

/**
 * @description: 音乐详情接口
 * @return {Object}  返回音乐详情
 */
export function getMusicDetail(id) {
  return request({
    url: `music/song/${id}`,
    method: "get"
  });
}

/**
 * @description: 音乐歌词接口
 * @return {Object}  返回音乐歌词
 */
export function getMusicLrc(id) {
  return request({
    url: `/music/lrc/${id}`,
    method: "get"
  });
}

/**
 * @description: 音乐地址接口
 * @return {Object}  返回音乐地址
 */
export function getMusicUrl(id) {
  return request({
    url: `/music/url/${id}`,
    method: "get"
  });
}